Device
Device Chooser communication with device package OSErr Device( message, caller, objName, zoneName, p1, p2 ); short message ; value identifying operation to be performed.
short caller ; value of 1 identifies caller as the Chooser
StringPtr objName ; address of device name Up to 32 characters with the name of the device
identifying an AppleTalk zone
long p1 ; handle to a List Manager list of choices for device long p2 ; address of either the list or the AppleTalk device
The Chooser communicates with device packages as if they were like this
function. If you are writing a device package it should have this form. This is
not a toolbox routine that you can call.
message is the identity of the operation to be performed. It will be one of:
12=newSelMsg=new user selection;
13=fillListMsg=fill list with choices;
14=getSelMsg=mark single or multiple choices as selected;
15=selectMsg=a choice was made;
16=deselectMsg=cancel a choice;
17=terminateMsg=end choice process;
19= buttonMsg=a button was selected.
caller identifies: Chooser = 1; values 0 to 127 = reserved;
values 128 and above = application.
objName identifies the device.
zoneName identifies the AppleTalk zone where the device is located. p1 is a handle to the device list, which is filled by the device package in
response to the fillListMsg.
p2 is either the row number of the list selected by fillListMsg or the
address block value of the address of an AppleTalk device.
noErr (0) No error
Notes: Chooser messages listed above have additional features:
The newSelMsg is sent only to device packages that permit multiple selections, and only when the user changes the selection. When newSelMsg
is in Device's message parameter, neither the objName nor the p2
parameters are used.
list with choices for a device and the p1 parameter is the handle to the list.
When fillLstMsg is in Device's message parameter neither the objName nor
the p2 parameters are used.
The getSelMsg is sent to tell the device package to use a call to LSetSelect to indicate that one or more choices in the current list have been selected.
When getSelMsg is in Device's message parameter neither the objName nor
the p2 parameters are used.
The selectMsg value in the message parameter is sent whenever a particular choice is selected, but it is only sent to devices that permit only
single selections. The device cannot call the List Manager. If the device accepts fillList messages, the objName parameter is not used but the p2
parameter gives the row number of the list that was selected. If the device
doesn't accept fillList messages, the objName parameter points to a
32-character string (maximum) that names the device and the p2
parameter holds the AddrBlock value for a selected AppleTalk device's
address.
The deSelectMsg value in the message parameter is sent to deselect a message and is the opposite of of the SelectMsg. All conditions for the other
parameters are the same as for SelectMsg.
picks a different icon, closes the Chooser window or shifts to an other
AppleTalk zone. It also facilitates any cleanup tasks by the device package
that may be required. When terminateMsg is in the Device's message
parameter neither the objName nor the p2 parameters are used.
The buttonMsg value in the message parameter is sent when a Chooser display button is pushed. In the p2 parameter, a value of 1 in the
low-order byte means that the left button was pushed while a value of 2
means that the right button was chosen. The objName parameter is not used.
Device is not a routine that you can call. It specifies the way that device more information on the way that the Chooser communicates with device
packages.